// main.cpp
#include "../../common/include/commondef.h"
#include "../../common/include/std.h"
extern "C"
{
}

#pragma pack(1) // 字节对齐
typedef struct
{
} ST;
#pragma pack()

int main(int argc, const char *argv[])
{
    int iRet = -1;
    int iResult, iTmp;

    iRet = 0;
_Exit:
    PRESS_ANY_KEY_TO_CONTINUE;
    return iRet;
}

int fun1(int *p)
{
    int iRet = -1;
    int iResult, iTmp;

    if(p == NULL) SET_RET_AND_GOTO_EXIT(COMMON_ERR_INV_ARGS);

    iRet = 0;
_Exit:
    return iRet;
}

void fun2()
{
    int iResult, iTmp;

_Exit:
    return;
}

void fun3()
{
    int i, j, k;

    for(i = 0; i < 10; i++)
    {
    }
    ////[
    //]
    switch(i)
    {
    case 0:
        break;
    default:
        break;
    }
}

BOOL WINAPI DllMain(HINSTANCE hInstDll, // handle to DLL module
                    DWORD dwReason,     // reason for calling function
                    LPVOID lpReserved)  // reserved
{
    // Perform actions based on the reason for calling.
    switch(dwReason)
    {
    case DLL_PROCESS_ATTACH:
        // Initialize once for each new process.
        // Return FALSE to fail DLL load.
        break;

    case DLL_THREAD_ATTACH:
        // Do thread-specific initialization.
        break;

    case DLL_THREAD_DETACH:
        // Do thread-specific cleanup.
        break;

    case DLL_PROCESS_DETACH:
        // Perform any necessary cleanup.
        break;
    }
    return TRUE;
}

DWORD WINAPI WinThrdFun_t(LPVOID lpParam) // 线程
{
    int iResult, iTmp;

_Exit:
    return 0;
}
